package com.example.radio_groupbutton;



import javax.security.auth.login.LoginException;


import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;

public class MainActivity extends Activity implements OnCheckedChangeListener{
	private RadioGroup rg;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        rg = (RadioGroup) findViewById(R.id.radioGroup1);
        /*
         * 监听事件
         */
        rg.setOnCheckedChangeListener(this);
        
    }
	@Override
	public void onCheckedChanged(RadioGroup group, int checkedId) {
	switch (checkedId) {
	
	case R.id.radio0:
		Log.i("tag","你他妈是男的");
				
		break;
	case R.id.radio1:
		Log.i("tag", "你他妈是女的");
	default:
		break;
	}
		
	}
    
}
